<template>
  <div class="no-auth-box">
    <div class="no-auth">
      <img :src="tipsPic" />
      <slot>
        <!-- 默认展示，可通过slot覆盖，class样式加了deep，可在slot中复用 -->
        <p class="desc">{{ tipsText || $t('component.noAuth.tip')}}</p>
        <el-button
          type="primary"
          class="operation-btn"
          @click="$emit('btn-event')"
          v-if="isButtonShow">
          {{ buttonText || $t('component.noAuth.feedbackBth') }}
        </el-button>
      </slot>
    </div>
  </div>
</template>

<script>
import { getOssUrl } from '@src/util/assets'

export default {
  name: 'no-auth',
  props: {
    tipsText: {
      type: String
    },
    buttonText: {
      type: String
    },
    isButtonShow: {
      type: Boolean,
      default: false
    },
    tipsPic: {
      type: String,
      default: getOssUrl('/no_auth.png')
    },
  }
}
</script>
<style lang="scss" scoped>
.no-auth-box {
  height:100%;
  padding: 16px;
  display: flex;
  flex-direction: column;
  justify-content: center;
}
.no-auth{
  padding-top: 170px;
  flex: 1;
  text-align: center;
  background: #fff;
  border-radius: 4px;
  img {
    width: 160px;
    height: 160px;
  }
  ::v-deep .desc {
    margin: 8px 0 0;
    font-size: 14px;
    font-family: PingFangSC-Regular, PingFang SC;
    font-weight: 400;
    color: #595959;
    line-height: 20px;
  }
  ::v-deep .operation-btn {
    margin-top: 16px;
  }
}
</style>
